﻿using System;
using System.Reflection;

[AttributeUsage(AttributeTargets.Method)]
class VersionAttribute : System.Attribute
{
    private string name;
    private string description;

    public VersionAttribute(string name)
    {
        this.name = name;
    }

    public VersionAttribute(string name, string description)
    {
        this.name = name;
        this.description = description;
    }

    public string Name
    {
        get
        {
            return name;
        }
    }

    public string Description
    {
        get
        {
            return description;
        }
    }

    [Version("22")]
    private void NormalMethod()
    { }

    [Version("original","44,3")]
    public static void Main()
    {
        var mi = typeof(VersionAttribute).GetMethod("Main");

        Console.Write(mi.Name + " -> ");
            foreach (var attr in mi.GetCustomAttributes(false))
            {
                Console.Write("{0} {1}", (attr as VersionAttribute).Name, (attr as VersionAttribute).Description);
            }
            Console.WriteLine();
        
    }
}

